<%--
  Created by IntelliJ IDEA.
  User: 陈俊雄
  Date: 2018/6/26
  Time: 15:15
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<!-- Main view -->
<div class="animated fadeInRight">
    <div class="wrapper wrapper-content ng-scope" ng-controller="merchantSettingCtrl">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{goType == null ? 'MERCHANT_ADD' : 'MERCHANT_SETTING' | translate}}</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="sk-spinner sk-spinner-wave">
                            <div class="sk-rect1"></div>
                            <div class="sk-rect2"></div>
                            <div class="sk-rect3"></div>
                            <div class="sk-rect4"></div>
                            <div class="sk-rect5"></div>
                        </div>
                        <div class="bg-muted p-xxs m-t-sm m-b-sm b-r-sm text-center">商户号：{{merchant.merchantInfo.id}}
                        </div>
                        <form name="myForm">
                            <div class="form-group">
                                <label>结算信息</label>
                                <div class="table-responsive">
                                    <table class="table table-bordered">
                                        <thead>
                                        <tr>
                                            <th class="text-center">开户银行</th>
                                            <th class="text-center">开户人名</th>
                                            <th class="text-center">开户账号</th>
                                            <th class="text-center">结算币种</th>
                                            <th class="text-center">结算周期</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td class="text-center">
                                                <input style="width: 100%" class="text-center"
                                                       type="text" ng-model="merchant.merchantSetting.bankName"
                                                       maxlength="100"
                                                       required>
                                            </td>
                                            <td class="text-center">
                                                <input style="width: 100%" class="text-center" type="text"
                                                       ng-model="merchant.merchantSetting.bankOwner"
                                                       maxlength="50"
                                                       required>
                                            </td>
                                            <td class="text-center">
                                                <input style="width: 100%" class="text-center" type="text"
                                                       ng-model="merchant.merchantSetting.bankAccount"
                                                       maxlength="50"
                                                       required>
                                            </td>
                                            <td class="text-center">
                                                <select ng-model="merchant.merchantSetting.transferCurrency"
                                                        ng-options="x.firstValue as x.name for x in currency" required>
                                                </select>
                                            </td>
                                            <td class="text-center">
                                                <input style="width: 100%" class="text-center" type="text"
                                                       ng-model="merchant.merchantSetting.settleCycle"
                                                       maxlength="2"
                                                       oninput="inputRegex(this, /\D/g)"
                                                       required>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="form-group">
                                <label>费用信息</label>
                                <div class="table-responsive">
                                    <table class="table table-bordered">
                                        <thead>
                                        <tr>
                                            <th class="text-center">开户费</th>
                                            <th class="text-center">年费</th>
                                            <th class="text-center">划款手续费（CNY）</th>
                                            <th class="text-center">拒付处理费</th>
                                            <th class="text-center">退款手续费</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td class="text-center">
                                                <input style="width: 100%" class="text-center" type="text"
                                                       ng-model="merchant.merchantSetting.openFee"
                                                       maxlength="8"
                                                       oninput="inputRegex(this, /\D/g)"
                                                       required>
                                            </td>
                                            <td class="text-center">
                                                <input style="width: 100%" class="text-center" type="text"
                                                       ng-model="merchant.merchantSetting.yearFee"
                                                       maxlength="8"
                                                       oninput="inputRegex(this, /\D/g)"
                                                       required>
                                            </td>
                                            <td class="text-center">
                                                <input style="width: 100%" class="text-center" type="text"
                                                       ng-model="merchant.merchantSetting.transferFee"
                                                       maxlength="4"
                                                       oninput="inputRegex(this, /\D/g)"
                                                       required>
                                            </td>
                                            <td class="text-center">
                                                <input style="width: 100%" class="text-center" type="text"
                                                       ng-model="merchant.merchantSetting.dishonor"
                                                       maxlength="4"
                                                       oninput="inputRegex(this, /\D/g)"
                                                       required>
                                            </td>
                                            <td class="text-center">
                                                <input style="width: 100%" class="text-center" type="text"
                                                       ng-model="merchant.merchantSetting.refundFee"
                                                       maxlength="4"
                                                       oninput="inputRegex(this, /\D/g)"
                                                       required>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="form-group">
                                <label>物流设置</label>
                                <div class="table-responsive">
                                    <table class="table table-bordered">
                                        <thead>
                                        <tr>
                                            <th class="text-center">跟踪设置</th>
                                            <th class="text-center">跟踪审核</th>
                                            <th class="text-center">是否妥投</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td class="text-center">
                                                <select ng-model="merchant.merchantSetting.trackType"
                                                        ng-options="+(x.firstValue) as x.name for x in trackSetting"
                                                        required>
                                                </select>
                                            </td>
                                            <td class="text-center">
                                                <select ng-model="merchant.merchantSetting.trackAudit"
                                                        ng-options="+(x.firstValue) as x.name for x in trackAudit"
                                                        required>
                                                </select>
                                            </td>
                                            <td class="text-center">
                                                <select ng-model="merchant.merchantSetting.correctDistribute"
                                                        ng-options="+(x.firstValue) as x.name for x in correctDistribute"
                                                        required>
                                                </select>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="form-group clearfix">
                                <div class="col-lg-6 center">
                                    <button class="btn btn-sm"
                                            ng-class="{'btn-primary' : goType == null, 'btn-success' : goType == 1}"
                                            type="button" ng-click="confirm()"
                                            ng-disabled="confirmDisabled(myForm)">
                                        {{goType == null ? '下一步' : '确定'}}
                                    </button>
                                    <button class="btn btn-sm btn-info" type="button" ng-click="cancel()">
                                        {{goType == null ? '上一步' : '取消'}}
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
